package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * DeliveryPerson generated by hbm2java
 */
@Entity
@Table(name = "delivery_person", catalog = "cabinet")
public class DeliveryPerson implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer deliveryPersonId;
	private UserGroup userGroup;
	private String number;
	private String name;
	private String phone;
	private String email;
	private Byte status;
	private Integer insertUser;
	private Date insertTime;
	private boolean deleted;
	private Set<RefundOrderInfo> refundOrderInfos = new HashSet<RefundOrderInfo>(0);
	private Set<LockerDeliveryPerson> lockerDeliveryPersons = new HashSet<LockerDeliveryPerson>(0);

	public DeliveryPerson() {
	}

	public DeliveryPerson(UserGroup userGroup, String number, String name, String phone) {
		this.userGroup = userGroup;
		this.number = number;
		this.name = name;
		this.phone = phone;
	}

	public DeliveryPerson(UserGroup userGroup, String number, String name, String phone, String email, Byte status, Integer insertUser, Date insertTime, boolean deleted, Set<RefundOrderInfo> refundOrderInfos, Set<LockerDeliveryPerson> lockerDeliveryPersons) {
		this.userGroup = userGroup;
		this.number = number;
		this.name = name;
		this.phone = phone;
		this.email = email;
		this.status = status;
		this.insertUser = insertUser;
		this.insertTime = insertTime;
		this.deleted = deleted;
		this.refundOrderInfos = refundOrderInfos;
		this.lockerDeliveryPersons = lockerDeliveryPersons;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "delivery_person_id", unique = true, nullable = false)
	public Integer getDeliveryPersonId() {
		return this.deliveryPersonId;
	}

	public void setDeliveryPersonId(Integer deliveryPersonId) {
		this.deliveryPersonId = deliveryPersonId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "group_id", nullable = false)
	@NotNull
	public UserGroup getUserGroup() {
		return this.userGroup;
	}

	public void setUserGroup(UserGroup userGroup) {
		this.userGroup = userGroup;
	}

	@Column(name = "number", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getNumber() {
		return this.number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Column(name = "name", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "phone", nullable = false, length = 11)
	@NotNull
	@Length(max = 11)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "email", length = 100)
	@Length(max = 100)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "status")
	public Byte getStatus() {
		return this.status;
	}

	public void setStatus(Byte status) {
		this.status = status;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "deleted")
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "deliveryPerson")
	public Set<RefundOrderInfo> getRefundOrderInfos() {
		return this.refundOrderInfos;
	}

	public void setRefundOrderInfos(Set<RefundOrderInfo> refundOrderInfos) {
		this.refundOrderInfos = refundOrderInfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "deliveryPerson")
	public Set<LockerDeliveryPerson> getLockerDeliveryPersons() {
		return this.lockerDeliveryPersons;
	}

	public void setLockerDeliveryPersons(Set<LockerDeliveryPerson> lockerDeliveryPersons) {
		this.lockerDeliveryPersons = lockerDeliveryPersons;
	}

}
